package studio.raptor.databus.dashboard.api;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import studio.raptor.databus.dashboard.repository.App;
import studio.raptor.databus.dashboard.service.interfaces.AppService;

/**
 * 业务应用接口
 *
 * @author Sam
 * @since 3.1.0
 */
@RestController
public class AppController {

  private AppService appService;

  @Autowired
  public AppController(AppService appService) {
    this.appService = appService;
  }

  @RequestMapping(value = "/app/under/{center}")
  public @ResponseBody List<App> findAppByCenterName(@PathVariable String center) {
    return appService.findByCenterName(center);
  }
}
